﻿namespace DocumentMaking.Lib.Models;

[Serializable]
public class SettingModel
{
    public string? DefaultOutputPath { get; set; }
    public string? DefaultOrganize { get; set; }
    public string? ThemeMode { get; set; }

    public static SettingModel Default => new()
    {
        DefaultOrganize = "西安建筑科技大学iOS众创空间俱乐部",
        DefaultOutputPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
        ThemeMode = "Next"
    };

    public override bool Equals(object? obj)
    {
        if (obj is not SettingModel model) return false;
        return DefaultOrganize == model.DefaultOrganize && DefaultOutputPath == model.DefaultOutputPath &&
               ThemeMode == model.ThemeMode;
    }

    protected bool Equals(SettingModel other)
    {
        return DefaultOutputPath == other.DefaultOutputPath && DefaultOrganize == other.DefaultOrganize &&
               ThemeMode == other.ThemeMode;
    }

    public override int GetHashCode()
    {
        // ReSharper disable once BaseObjectGetHashCodeCallInGetHashCode
        return base.GetHashCode();
    }
}